import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import urlData from '../commom/url'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      //默认路由
      redirect: '/index',
      children: [
        {
          path: '/index',
          name: 'index',
          cname: '首页',
          component: () => import('../views/IndexHome.vue'),
        },
        ...urlData,
      ],
    },
  ],
})

export default router
